﻿using System.ComponentModel.DataAnnotations;
using Dexter.Web.Mvc.ViewModel.Resources;

namespace Dexter.Web.Mvc.ViewModel.Backoffice.Binders {
	public class SetupBinder {
		/// <summary>
		/// Initializes a new instance of the <see cref="T:System.Object"/> class.
		/// </summary>
		public SetupBinder ( ) {
			CreateDatabase = true;
			DatabaseSchema = "dbo";
			DatabaseTablePrefix = "Dexter_";
			DatabaseType = "MsSql2008";
		}

		[Required ( ErrorMessageResourceType = typeof ( Errors ), ErrorMessageResourceName = "RequiredField" )]
		[StringLength ( 100, ErrorMessageResourceType = typeof ( Errors ), ErrorMessageResourceName = "MaximumLengthExceeded" )]
		public string WebSiteName { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ), ErrorMessageResourceName = "RequiredField" )]
		public string SiteDomain { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ), ErrorMessageResourceName = "RequiredField" )]
		public string Language { get; set; }

		public string TimeZone { get; set; }
		
		public string CultureInfo { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ), ErrorMessageResourceName = "RequiredField" )]
		public string Username { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ), ErrorMessageResourceName = "RequiredField" )]
		public string Password { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ), ErrorMessageResourceName = "RequiredField" )]
		public string ConfirmPassword { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ), ErrorMessageResourceName = "RequiredField" )]
		public string Email { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ), ErrorMessageResourceName = "RequiredField" )]
		public string ConfirmEmail { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ), ErrorMessageResourceName = "RequiredField" )]
		public string ConnectionString { get; set; }

		public bool CreateDatabase { get; set; }

		public string DatabaseType { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ), ErrorMessageResourceName = "RequiredField" )]
		public string DatabaseSchema { get; set; }

		public string DatabaseTablePrefix { get; set; }
	}
}
